package com.example.springbootmybatis;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("SELECT name,age FROM student WHERE NAME = #{name}")
    User findByName(@Param("name") String name);

    @Insert("INSERT INTO student (NAME,AGE) VALUES (#{name} ,#{age})")
    Integer insert(@Param("name") String name,@Param("age") Integer age );
}
